<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::SimpleNearestNeighbors&lt; InputType, LabelType &gt; Class Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html">SimpleNearestNeighbors</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_simple_nearest_neighbors-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::SimpleNearestNeighbors&lt; InputType, LabelType &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Brute force optimized nearest neighbor implementation.  
 <a href="classshark_1_1_simple_nearest_neighbors.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_simple_nearest_neighbors_8h_source.html">shark/Algorithms/NearestNeighbors/SimpleNearestNeighbors.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for shark::SimpleNearestNeighbors&lt; InputType, LabelType &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classshark_1_1_simple_nearest_neighbors__inherit__graph.png" border="0" usemap="#ashark_1_1_simple_nearest_neighbors_3_01_input_type_00_01_label_type_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="ashark_1_1_simple_nearest_neighbors_3_01_input_type_00_01_label_type_01_4_inherit__map" id="ashark_1_1_simple_nearest_neighbors_3_01_input_type_00_01_label_type_01_4_inherit__map">
<area shape="rect" title="Brute force optimized nearest neighbor implementation." alt="" coords="10,94,216,135"/>
<area shape="rect" href="classshark_1_1_abstract_nearest_neighbors.html" title="Interface for Nearest Neighbor queries." alt="" coords="5,5,221,46"/>
<area shape="poly" title=" " alt="" coords="116,62,116,94,110,94,110,62"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a34c2838b82d29e9f725bef18d3540514" id="r_a34c2838b82d29e9f725bef18d3540514"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a34c2838b82d29e9f725bef18d3540514">Dataset</a></td></tr>
<tr class="separator:a34c2838b82d29e9f725bef18d3540514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac39c0a94032d08b667e3cb692f514fbd" id="r_ac39c0a94032d08b667e3cb692f514fbd"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_metric.html">AbstractMetric</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ac39c0a94032d08b667e3cb692f514fbd">Metric</a></td></tr>
<tr class="separator:ac39c0a94032d08b667e3cb692f514fbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae85bcee60ffdda60be8830e682785b9c" id="r_ae85bcee60ffdda60be8830e682785b9c"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#aca52936d3edcb0538a5be59fff147216">base_type::DistancePair</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ae85bcee60ffdda60be8830e682785b9c">DistancePair</a></td></tr>
<tr class="separator:ae85bcee60ffdda60be8830e682785b9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad878c943fb9776f495b796d718e3a099" id="r_ad878c943fb9776f495b796d718e3a099"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> &gt;::type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ad878c943fb9776f495b796d718e3a099">BatchInputType</a></td></tr>
<tr class="separator:ad878c943fb9776f495b796d718e3a099"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_classshark_1_1_abstract_nearest_neighbors"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classshark_1_1_abstract_nearest_neighbors')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;</a></td></tr>
<tr class="memitem:aca52936d3edcb0538a5be59fff147216 inherit pub_types_classshark_1_1_abstract_nearest_neighbors" id="r_aca52936d3edcb0538a5be59fff147216"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_key_value_pair.html">KeyValuePair</a>&lt; double, LabelType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#aca52936d3edcb0538a5be59fff147216">DistancePair</a></td></tr>
<tr class="separator:aca52936d3edcb0538a5be59fff147216 inherit pub_types_classshark_1_1_abstract_nearest_neighbors"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a246b7524f57646d1d830e03c05773824 inherit pub_types_classshark_1_1_abstract_nearest_neighbors" id="r_a246b7524f57646d1d830e03c05773824"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> &gt;::type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a246b7524f57646d1d830e03c05773824">BatchInputType</a></td></tr>
<tr class="separator:a246b7524f57646d1d830e03c05773824 inherit pub_types_classshark_1_1_abstract_nearest_neighbors"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac5425f13309ffab8422d344accddd3fa" id="r_ac5425f13309ffab8422d344accddd3fa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ac5425f13309ffab8422d344accddd3fa">SimpleNearestNeighbors</a> (<a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a34c2838b82d29e9f725bef18d3540514">Dataset</a> const &amp;<a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a87bb8ea903edac0d8a5ad560be47f47d">dataset</a>, <a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ac39c0a94032d08b667e3cb692f514fbd">Metric</a> const *metric)</td></tr>
<tr class="memdesc:ac5425f13309ffab8422d344accddd3fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <br /></td></tr>
<tr class="separator:ac5425f13309ffab8422d344accddd3fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a389a29728ce4a6d7e50e2b94d449eb87" id="r_a389a29728ce4a6d7e50e2b94d449eb87"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ae85bcee60ffdda60be8830e682785b9c">DistancePair</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a389a29728ce4a6d7e50e2b94d449eb87">getNeighbors</a> (<a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ad878c943fb9776f495b796d718e3a099">BatchInputType</a> const &amp;patterns, std::size_t k) const</td></tr>
<tr class="memdesc:a389a29728ce4a6d7e50e2b94d449eb87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the k nearest neighbors of the query point.  <br /></td></tr>
<tr class="separator:a389a29728ce4a6d7e50e2b94d449eb87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87bb8ea903edac0d8a5ad560be47f47d" id="r_a87bb8ea903edac0d8a5ad560be47f47d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt; const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a87bb8ea903edac0d8a5ad560be47f47d">dataset</a> () const</td></tr>
<tr class="memdesc:a87bb8ea903edac0d8a5ad560be47f47d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direct access to the underlying data set of nearest neighbor points.  <br /></td></tr>
<tr class="separator:a87bb8ea903edac0d8a5ad560be47f47d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_abstract_nearest_neighbors"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_abstract_nearest_neighbors')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;</a></td></tr>
<tr class="memitem:a34d4b8de6de6c7eab9565d2e0eb4117d inherit pub_methods_classshark_1_1_abstract_nearest_neighbors" id="r_a34d4b8de6de6c7eab9565d2e0eb4117d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classshark_1_1_shape.html">Shape</a> const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a34d4b8de6de6c7eab9565d2e0eb4117d">inputShape</a> () const</td></tr>
<tr class="memdesc:a34d4b8de6de6c7eab9565d2e0eb4117d inherit pub_methods_classshark_1_1_abstract_nearest_neighbors"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the expected shape of the inputs.  <br /></td></tr>
<tr class="separator:a34d4b8de6de6c7eab9565d2e0eb4117d inherit pub_methods_classshark_1_1_abstract_nearest_neighbors"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3af2987f23272193ca3a26cba59ce7d8 inherit pub_methods_classshark_1_1_abstract_nearest_neighbors" id="r_a3af2987f23272193ca3a26cba59ce7d8"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a3af2987f23272193ca3a26cba59ce7d8">~AbstractNearestNeighbors</a> ()</td></tr>
<tr class="separator:a3af2987f23272193ca3a26cba59ce7d8 inherit pub_methods_classshark_1_1_abstract_nearest_neighbors"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classshark_1_1_abstract_nearest_neighbors"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classshark_1_1_abstract_nearest_neighbors')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;</a></td></tr>
<tr class="memitem:a71d274e64e2eff7e1f72fa4fe3fb3473 inherit pro_attribs_classshark_1_1_abstract_nearest_neighbors" id="r_a71d274e64e2eff7e1f72fa4fe3fb3473"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classshark_1_1_shape.html">Shape</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a71d274e64e2eff7e1f72fa4fe3fb3473">m_inputShape</a></td></tr>
<tr class="separator:a71d274e64e2eff7e1f72fa4fe3fb3473 inherit pro_attribs_classshark_1_1_abstract_nearest_neighbors"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, class LabelType&gt;<br />
class shark::SimpleNearestNeighbors&lt; InputType, LabelType &gt;</div><p>Brute force optimized nearest neighbor implementation. </p>
<p>Returns the labels and distances of the k nearest neighbors of a point The distance is measured using an arbitrary metric </p>

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00051">51</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="ad878c943fb9776f495b796d718e3a099" name="ad878c943fb9776f495b796d718e3a099"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad878c943fb9776f495b796d718e3a099">&#9670;&#160;</a></span>BatchInputType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structshark_1_1_batch.html">Batch</a>&lt;<a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>&gt;::type <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::BatchInputType</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00058">58</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

</div>
</div>
<a id="a34c2838b82d29e9f725bef18d3540514" name="a34c2838b82d29e9f725bef18d3540514"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34c2838b82d29e9f725bef18d3540514">&#9670;&#160;</a></span>Dataset</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt;<a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType&gt; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::Dataset</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00055">55</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

</div>
</div>
<a id="ae85bcee60ffdda60be8830e682785b9c" name="ae85bcee60ffdda60be8830e682785b9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae85bcee60ffdda60be8830e682785b9c">&#9670;&#160;</a></span>DistancePair</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#aca52936d3edcb0538a5be59fff147216">base_type::DistancePair</a> <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::DistancePair</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00057">57</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

</div>
</div>
<a id="ac39c0a94032d08b667e3cb692f514fbd" name="ac39c0a94032d08b667e3cb692f514fbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac39c0a94032d08b667e3cb692f514fbd">&#9670;&#160;</a></span>Metric</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classshark_1_1_abstract_metric.html">AbstractMetric</a>&lt;<a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>&gt; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::Metric</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00056">56</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac5425f13309ffab8422d344accddd3fa" name="ac5425f13309ffab8422d344accddd3fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5425f13309ffab8422d344accddd3fa">&#9670;&#160;</a></span>SimpleNearestNeighbors()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::SimpleNearestNeighbors </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#a34c2838b82d29e9f725bef18d3540514">Dataset</a> const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ac39c0a94032d08b667e3cb692f514fbd">Metric</a> const *&#160;</td>
          <td class="paramname"><em>metric</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="section user"><dt>Construct a "brute force" nearest neighbors search algorithm</dt><dd>from data and a metric. Refer to the <a class="el" href="classshark_1_1_abstract_metric.html" title="Base-class for metrics.">AbstractMetric</a> class for details. The "default" Euclidean metric is realized by providing a pointer to an object of type LinearKernel&lt;InputType&gt;. </dd></dl>

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00066">66</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

<p class="reference">References <a class="el" href="group__shark__globals.html#ga134d41e34c69c494346367a570bf4ff8">shark::LabeledData&lt; InputT, LabelT &gt;::inputShape()</a>, and <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a71d274e64e2eff7e1f72fa4fe3fb3473">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;::m_inputShape</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a87bb8ea903edac0d8a5ad560be47f47d" name="a87bb8ea903edac0d8a5ad560be47f47d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87bb8ea903edac0d8a5ad560be47f47d">&#9670;&#160;</a></span>dataset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt; const  &amp; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::dataset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Direct access to the underlying data set of nearest neighbor points. </p>

<p>Implements <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a22661db718a970568b31ab9ae47d83ad">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00138">138</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

</div>
</div>
<a id="a389a29728ce4a6d7e50e2b94d449eb87" name="a389a29728ce4a6d7e50e2b94d449eb87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a389a29728ce4a6d7e50e2b94d449eb87">&#9670;&#160;</a></span>getNeighbors()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> , class LabelType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ae85bcee60ffdda60be8830e682785b9c">DistancePair</a> &gt; <a class="el" href="classshark_1_1_simple_nearest_neighbors.html">shark::SimpleNearestNeighbors</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, LabelType &gt;::getNeighbors </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_simple_nearest_neighbors.html#ad878c943fb9776f495b796d718e3a099">BatchInputType</a> const &amp;&#160;</td>
          <td class="paramname"><em>patterns</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the k nearest neighbors of the query point. </p>

<p>Implements <a class="el" href="classshark_1_1_abstract_nearest_neighbors.html#a72a116504675a53f288533bfeff3a96d">shark::AbstractNearestNeighbors&lt; InputType, LabelType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_simple_nearest_neighbors_8h_source.html#l00072">72</a> of file <a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a>.</p>

<p class="reference">References <a class="el" href="group__shark__globals.html#ga192f5eced10acf38f3ae723a3c400d98">shark::LabeledData&lt; InputT, LabelT &gt;::batch()</a>, <a class="el" href="namespaceshark.html#af2ab10364feb8a631e0866dcf2f1a4ad">shark::batchSize()</a>, <a class="el" href="classshark_1_1_abstract_metric.html#a249ddd25ea56bc592ea2f8386070714d">shark::AbstractMetric&lt; InputTypeT &gt;::featureDistanceSqr()</a>, <a class="el" href="namespaceshark.html#a1531880b9b4076854b0b26441d353242">shark::getBatchElement()</a>, <a class="el" href="group__shark__globals.html#gaca4b1e6083184385dba76a21b4c1d42b">shark::LabeledData&lt; InputT, LabelT &gt;::numberOfBatches()</a>, <a class="el" href="_open_m_p_8h.html#afe4c8d5e3dea340345071efe7bf69a0a">SHARK_NUM_THREADS</a>, <a class="el" href="_open_m_p_8h.html#a8a63d79e2c3625260e6092d933f21a98">SHARK_PARALLEL_FOR</a>, and <a class="el" href="_open_m_p_8h.html#a24697345975eb5504b786009159a1f5b">SHARK_THREAD_NUM</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Algorithms/NearestNeighbors/<a class="el" href="_simple_nearest_neighbors_8h_source.html">SimpleNearestNeighbors.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
